package com.qfedu.buy.common.vo;

import com.qfedu.buy.common.config.SystemConfig;
import lombok.Data;

/**
 * @program: NeighborBuy
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-01-25 14:51
 */
@Data
public class R {
    private int code;
    private String msg;
    private Object data;

    public R(){

    }
    public R(int code,String msg,Object obj){
        this.code=code;
        this.msg=msg;
        this.data=obj;
    }
    public static R ok(){
        return new R(SystemConfig.R_OK,"OK",null);
    }
    public static R ok(Object obj){
        return new R(SystemConfig.R_OK,"OK",obj);
    }
    public static R fail(){
        return new R(SystemConfig.R_FAIL,"FAIL",null);
    }
    public static R fail(String msg){
        return new R(SystemConfig.R_FAIL,msg,null);
    }
}
